home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / extra_2 / testvb.zip / MAIN.FRM < prev    next >
Text File  |  1995-11-02  |  3KB  |  101 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Concatonate Strings"
  5.    ClientHeight    =   2460
  6.    ClientLeft      =   876
  7.    ClientTop       =   1524
  8.    ClientWidth     =   6420
  9.    Height          =   2880
  10.    Left            =   828
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   2460
  13.    ScaleWidth      =   6420
  14.    Top             =   1152
  15.    Width           =   6516
  16.    Begin CommandButton Command1 
  17.       Caption         =   "&Make String"
  18.       Height          =   492
  19.       Left            =   2340
  20.       TabIndex        =   6
  21.       Top             =   1560
  22.       Width           =   1752
  23.    End
  24.    Begin TextBox Text3 
  25.       Height          =   288
  26.       Left            =   1740
  27.       TabIndex        =   5
  28.       Top             =   1080
  29.       Width           =   4572
  30.    End
  31.    Begin TextBox Text2 
  32.       Height          =   288
  33.       Left            =   1740
  34.       TabIndex        =   3
  35.       Text            =   " to work with computers"
  36.       Top             =   660
  37.       Width           =   3072
  38.    End
  39.    Begin TextBox Text1 
  40.       Height          =   288
  41.       Left            =   1740
  42.       TabIndex        =   1
  43.       Text            =   "I really like"
  44.       Top             =   240
  45.       Width           =   3072
  46.    End
  47.    Begin Label Label3 
  48.       BackColor       =   &H00C0C0C0&
  49.       Caption         =   "Final String"
  50.       Height          =   252
  51.       Left            =   180
  52.       TabIndex        =   4
  53.       Top             =   1080
  54.       Width           =   1392
  55.    End
  56.    Begin Label Label2 
  57.       BackColor       =   &H00C0C0C0&
  58.       Caption         =   "String &B"
  59.       Height          =   252
  60.       Left            =   180
  61.       TabIndex        =   2
  62.       Top             =   660
  63.       Width           =   1392
  64.    End
  65.    Begin Label Label1 
  66.       BackColor       =   &H00C0C0C0&
  67.       Caption         =   "String &A"
  68.       Height          =   252
  69.       Left            =   180
  70.       TabIndex        =   0
  71.       Top             =   240
  72.       Width           =   1392
  73.    End
  74. End
  75. Option Explicit
  76.  
  77. ' Take the two strings in the form and make a third
  78. Sub Command1_Click ()
  79.  
  80. Dim NewString$
  81. Dim StringA$
  82. Dim StringB$
  83. Dim SpaceNeeded%
  84.  
  85. ' Get the strings from the text controls
  86. StringA = Text1
  87. StringB = Text2
  88.  
  89. ' Allocate space for new string
  90. SpaceNeeded = Len(StringA) + Len(StringB) + 1
  91. NewString = Space$(SpaceNeeded)
  92.  
  93. ' Call the DLL function
  94. AddStrings StringA, StringB, NewString, SpaceNeeded
  95.  
  96. ' Show the new string
  97. Text3 = NewString
  98.  
  99. End Sub
  100.  
  101.